/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.fii.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Zeus
 */
@Entity
@Table(name = "pg_requisitos", catalog = "prog_acad", schema = "")
@NamedQueries({
    @NamedQuery(name = "PgRequisitos.findAll", query = "SELECT p FROM PgRequisitos p"),
    @NamedQuery(name = "PgRequisitos.findByPgcodPlan", query = "SELECT p FROM PgRequisitos p WHERE p.pgRequisitosPK.pgcodPlan = :pgcodPlan"),
    @NamedQuery(name = "PgRequisitos.findByPgcodCurso", query = "SELECT p FROM PgRequisitos p WHERE p.pgRequisitosPK.pgcodCurso = :pgcodCurso"),
    @NamedQuery(name = "PgRequisitos.findByPgcodRequisito", query = "SELECT p FROM PgRequisitos p WHERE p.pgRequisitosPK.pgcodRequisito = :pgcodRequisito"),
    @NamedQuery(name = "PgRequisitos.findByPgEstado", query = "SELECT p FROM PgRequisitos p WHERE p.pgEstado = :pgEstado")})
public class PgRequisitos implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected PgRequisitosPK pgRequisitosPK;
    @Basic(optional = false)
    @Column(name = "pg_estado", nullable = false)
    private char pgEstado;

    public PgRequisitos() {
    }

    public PgRequisitos(PgRequisitosPK pgRequisitosPK) {
        this.pgRequisitosPK = pgRequisitosPK;
    }

    public PgRequisitos(PgRequisitosPK pgRequisitosPK, char pgEstado) {
        this.pgRequisitosPK = pgRequisitosPK;
        this.pgEstado = pgEstado;
    }

    public PgRequisitos(String pgcodPlan, String pgcodCurso, String pgcodRequisito) {
        this.pgRequisitosPK = new PgRequisitosPK(pgcodPlan, pgcodCurso, pgcodRequisito);
    }

    public PgRequisitosPK getPgRequisitosPK() {
        return pgRequisitosPK;
    }

    public void setPgRequisitosPK(PgRequisitosPK pgRequisitosPK) {
        this.pgRequisitosPK = pgRequisitosPK;
    }

    public char getPgEstado() {
        return pgEstado;
    }

    public void setPgEstado(char pgEstado) {
        this.pgEstado = pgEstado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pgRequisitosPK != null ? pgRequisitosPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PgRequisitos)) {
            return false;
        }
        PgRequisitos other = (PgRequisitos) object;
        if ((this.pgRequisitosPK == null && other.pgRequisitosPK != null) || (this.pgRequisitosPK != null && !this.pgRequisitosPK.equals(other.pgRequisitosPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.fii.entity.PgRequisitos[ pgRequisitosPK=" + pgRequisitosPK + " ]";
    }
    
}
